package com.alex.xmlyfm.entities.discoverrecommend;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by
 * Author: alex
 * Email:
 * Date: 15-10-22.
 */
public class DiscoverColumns {

    /**
     * id : 1
     * orderNum : 2
     * title : 听友圈子
     * subtitle : 给你获得一种超能力的机会，你选择什么超能力？
     * coverPath : http://fdfs.xmcdn.com/group9/M07/1C/8C/wKgDYlV3rd2zGc9PAAAgRAu1VLU052.png
     * contentType : xzone
     * url :
     * sharePic :
     * enableShare : false
     * contentUpdatedAt : 0
     */

    public void parseJSON(JSONObject json) throws JSONException {
        if (json != null) {
            title = json.getString("title");
            subtitle = json.getString("subtitle");
            coverPath = json.getString("coverPath");
            url = json.optString("url");
            sharePic = json.optString("sharePic");
            enableShare = json.optBoolean("enableShare");
        }
    }

    private int id;
    private int orderNum;
    private String title;
    private String subtitle;
    private String coverPath;
    private String contentType;
    private String url;
    private String sharePic;
    private boolean enableShare;
    private int contentUpdatedAt;

    public void setId(int id) {
        this.id = id;
    }

    public void setOrderNum(int orderNum) {
        this.orderNum = orderNum;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    public void setCoverPath(String coverPath) {
        this.coverPath = coverPath;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void setSharePic(String sharePic) {
        this.sharePic = sharePic;
    }

    public void setEnableShare(boolean enableShare) {
        this.enableShare = enableShare;
    }

    public void setContentUpdatedAt(int contentUpdatedAt) {
        this.contentUpdatedAt = contentUpdatedAt;
    }

    public int getId() {
        return id;
    }

    public int getOrderNum() {
        return orderNum;
    }

    public String getTitle() {
        return title;
    }

    public String getSubtitle() {
        return subtitle;
    }

    public String getCoverPath() {
        return coverPath;
    }

    public String getContentType() {
        return contentType;
    }

    public String getUrl() {
        return url;
    }

    public String getSharePic() {
        return sharePic;
    }

    public boolean getEnableShare() {
        return enableShare;
    }

    public int getContentUpdatedAt() {
        return contentUpdatedAt;
    }
}
